package com.hawk.eye.server.convert;

import com.hawk.eye.server.domain.dto.resp.RuleRespDTO;
import com.hawk.eye.server.domain.vo.resp.RuleRespVO;
import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Named;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zd
 */
@Mapper
public interface RuleConvert {

    RuleConvert INSTANCE = Mappers.getMapper(RuleConvert.class);

    @Named(value = "to")
    RuleRespVO to(RuleRespDTO dto);

    @IterableMapping(qualifiedByName = "to")
    List<RuleRespVO> toList(List<RuleRespDTO> dto);

}